import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:thinking/utils/_.dart';

class StickyTabBarDelegate extends SliverPersistentHeaderDelegate {
  final Widget child;
  final double maxHeight;
  StickyTabBarDelegate({required this.child,required this.maxHeight});

  @override
  Widget build(
      BuildContext context, double shrinkOffset, bool overlapsContent) {
    return Container(
      child: this.child,
    );
  }

  @override
  double get maxExtent => Screen.setHeight(maxHeight);

  @override
  double get minExtent => 0;

  @override
  bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) {
    return true;
  }
}
